import { Component,ChangeDetectorRef } from '@angular/core';
import { NavController, LoadingController } from 'ionic-angular';
import { PhotoLibrary } from '@ionic-native/photo-library';
import { ItemDetailsPage } from'./item-details/item-details';


@Component({
  selector: 'page-others',
  templateUrl: 'others.html'
})
export class OthersPage {
  icons: string[];
  items: Array<{title: string, note: string, icon: string}>;

  constructor(public navCtrl: NavController,
              private photoLibrary: PhotoLibrary,
              public loadingCtrl: LoadingController) {

    this.icons = ['flask', 'wifi', 'beer', 'football', 'basketball', 'paper-plane',
    'american-football', 'boat', 'bluetooth', 'build'];

    this.items = [];
    for(let i = 0; i < 10; i++) {
      this.items.push({
        title: 'Item ' + i,
        note: 'This is item #' + i,
        icon: this.icons[Math.floor(Math.random() * this.icons.length)]
      });
    }
  }

  itemTapped(event, item) {
    this.navCtrl.push(ItemDetailsPage, {
        item: item
      });
  }
  





}

  





 
   



